let mongoose = require('mongoose');

let mongoDB = 'mongodb://localhost:27017/animals';

mongoose.Promise = global.Promise;

try{
    connection = mongoose.connect(mongoDB, {
        useNewUrlParser: true,
        useUnifiedTopology: true,
        checkServerIdentity: false,
    });
    console.log('connection to mongodb worked!');
} catch(e){
    console.log('error in db connection: ' +e.message);
}